//
//  OrderDetailStore.m
//  NewPro
//
//  Created by RYX on 2018/10/22.
//  Copyright © 2018年 何荧红. All rights reserved.
//

#import "OrderDetailStore.h"
#import "OrderDetailModel.h"

@implementation OrderDetailStore

#pragma mark - 获取订单详情
- (void)getOrderDetailWithId:(NSString *)uid Success:(void(^)(OrderDetailModel *model))success Failure:(void(^)(NSError *error))failure{
    
    NSString *url = [NSString stringWithFormat:@"%@/api/order/v1/orderDetails",IP];
    
    NSDictionary *dic = @{
                          @"orderId":uid
                          };
    
    [HttpTool getUrlWithString:url parameters:dic success:^(id responseObject) {
        
        NSError *error = [HttpTool inspectError:responseObject];
        
        if (error == nil) {
            
            OrderDetailModel *model = [OrderDetailModel mj_objectWithKeyValues:responseObject[@"data"]];
            success(model);
        }else{
            
            failure(error);
        }
    } failure:^(NSError *error) {
       
        failure(error);
    }];
    
}

@end



